package com.ruoyi.teaching.mapper;

import java.util.List;
import com.ruoyi.teaching.domain.StageInvestigate;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * 阶段问卷Mapper接口
 *
 * @author sunshine
 * @date 2024-02-15
 */
public interface StageInvestigateMapper
{
    /**
     * 查询阶段问卷
     *
     * @param id 阶段问卷主键
     * @return 阶段问卷
     */
    public StageInvestigate selectStageInvestigateById(Long id);

    /**
     * 查询阶段问卷列表
     *
     * @param stageInvestigate 阶段问卷
     * @return 阶段问卷集合
     */
    public List<StageInvestigate> selectStageInvestigateList(StageInvestigate stageInvestigate);

    /**
     * 新增阶段问卷
     *
     * @param stageInvestigate 阶段问卷
     * @return 结果
     */
    public int insertStageInvestigate(StageInvestigate stageInvestigate);

    /**
     * 修改阶段问卷
     *
     * @param stageInvestigate 阶段问卷
     * @return 结果
     */
    public int updateStageInvestigate(StageInvestigate stageInvestigate);

    /**
     * 删除阶段问卷
     *
     * @param id 阶段问卷主键
     * @return 结果
     */
    public int deleteStageInvestigateById(Long id);

    /**
     * 批量删除阶段问卷
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteStageInvestigateByIds(Long[] ids);


    @Update("update ya_stage_investigate set people_num = people_num+1 where id=#{id}")
    int updateStageInvestigateCount(@Param("id") Long id);

    @Update("update ya_stage_investigate set people_num = 1 where id=#{id}")
    void updateStageInvestigateById(@Param("id")Long id);
}
